package com.xadmin.sys.rbac.utils;

import com.xadmin.sys.rbac.pojo.Menu;
import com.xadmin.sys.rbac.vo.MenuVo;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author vic Ly
 */
public class Convert {
    public static List<MenuVo> convertToMenuVo(List<Menu> menuList){
        List<MenuVo> menuVoList = new ArrayList<>();
        for (Menu menu : menuList) {
            MenuVo menuVo = new MenuVo();
            BeanUtils.copyProperties(menu,menuVo);
            menuVoList.add(menuVo);
        }
        return  menuVoList;
    }
}
